home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / GRAPHICS.SWG / 0085_Virtual Screens.pas < prev    next >
Pascal/Delphi Source File  |  1994-05-25  |  1KB  |  38 lines

  1. {
  2.  
  3. WS>Hello! I've thought about writing my own 3D games or just any high graphics
  4. WS>program and am in the process of writing a unit that handles virtual screens
  5. WS>have 6 virtual screens (0..5, where 0 will be MOVEd to $A000:0000) that are
  6. WS>type pointer with 64000 bytes each. They are designed for Mode 13h, of cours
  7. WS>I have a procedure called CopyScreen. Basically,
  8.  
  9. Just FYI:  You might want to consider using Mode-X.  Matt Pritchard has
  10. written a great freeware library for such (MODEX10?.ZIP) with a Pascal
  11. example.  With Mode-X, you can use the VGA's memory instead of precious
  12. conventional (if in real mode) memory, and the page switching is a lot
  13. faster than copying 64k from memory.
  14. }
  15.  
  16. procedure copyscreen(source,dest : pointer; mask : byte); assembler;
  17.  
  18. asm
  19.   push  ds
  20.   lds   si,source
  21.   les   di,dest
  22.   mov   cx,64000
  23.   cld
  24. @loop:
  25.   lodsb
  26.   cmp   mask,al
  27.   je    @nodraw
  28.   mov   es:[di],al
  29. @nodraw:
  30.   inc   di
  31.   loop  @loop
  32.   pop   ds
  33. end;
  34.  
  35. You need to call it like this (note the '@'):
  36.  
  37.   copyscreen(@virtualscreen[first],@virtualscreen[second],mask);
  38.